<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2018 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2018/5/15
 * Time: 下午5:29
 */

namespace App\Helpers;


class Trade
{
    /**
     * @return string
     */
    public static function createItemSn(){
        return time().rand(100,999).rand(100,999);
    }

    /**
     * 生成交易流水号
     * @return string
     */
    public  static function createTradeNo(){
        return date('YmdHis').rand(100,999).rand(100,999);
    }

    /**
     * 生成订单号
     * @param $uid
     * @param string $type
     * @return string
     */
    public static function createOrderNo($uid, $type='6'){
        return $type.time().substr($uid, -5);
    }

    /**
     * @return string
     */
    public static function createReundNo(){
        return '4'.time().rand(100,999);
    }

    public static function getOrderTradeStatus($order){
        if (is_object($order)) {
            $order = get_object_vars($order);
        }


    }
}
